home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Chat & Communication / Digsby build 37 / digsby_setup.exe / lib / msn / conversationmanager.pyo (.txt) < prev    next >
Python Compiled Bytecode  |  2008-10-13  |  2KB  |  67 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4. import util
  5.  
  6. class ConversationManager(object):
  7.     
  8.     def __init__(self, msn):
  9.         self.msn = msn
  10.         self._convs = { }
  11.  
  12.     
  13.     def find_convo(self, name = (), count = (), type = (), f = None):
  14.         result = []
  15.         if f is None:
  16.             
  17.             f = lambda x: True
  18.         
  19.         if not util.isiterable(name):
  20.             name = (name,)
  21.         
  22.         if not util.isiterable(type):
  23.             type = (type,)
  24.         
  25.         if not util.isiterable(count):
  26.             count = (count,)
  27.         
  28.         functions = [
  29.             f]
  30.         
  31.         def namechecker(c):
  32.             mynames = set(name)
  33.             cnames = set(c.buddies)
  34.             mynames.discard(self.self_buddy.name)
  35.             cnames.discard(self.self_buddy.name)
  36.             return mynames == cnames
  37.  
  38.         if name:
  39.             functions.append(namechecker)
  40.         
  41.         
  42.         def typechecker(c):
  43.             return c.type in type
  44.  
  45.         if type:
  46.             functions.append(typechecker)
  47.         
  48.         
  49.         def countchecker(c):
  50.             return len(c.room_list) in count
  51.  
  52.         if count:
  53.             functions.append(countchecker)
  54.         
  55.         import inspect as inspect
  56.         log.debug('find_convo: name=%s,count=%s,type=%s,f=%s', name, count, type, inspect.getsource(f).strip())
  57.         for None in self._convs.values():
  58.             conv = None
  59.             if (all,)((lambda .0: for _f in .0:
  60. _f(conv))(functions)):
  61.                 result.append(conv)
  62.                 continue
  63.         
  64.         return result
  65.  
  66.  
  67.